(C++) Check for non-determinism caused by sorting of pointers.